//
//  tuikuanweiquanViewController.m
//  个人信息
//
//  Created by IOSchengxuyuan on 15/11/28.
//  Copyright (c) 2015年 com.ppfur. All rights reserved.
//

#import "tuikuanweiquanViewController.h"
#import "tuikuanguanliViewController.h"
#import "shouhouguanliViewController.h"
#import "tousuguanliViewController.h"
#import "zixunhuifuViewController.h"
@interface tuikuanweiquanViewController (){
    float aa,bb;
    float width,height;
    UITableViewCell*cell;
}

@end

@implementation tuikuanweiquanViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _mytable.delegate=self;
    _mytable.dataSource=self;
    width=[UIScreen mainScreen].bounds.size.width;
    height=[UIScreen mainScreen].bounds.size.height;
    aa=width/320;
    bb=height/568;
    
    _mytable.frame=CGRectMake(0, 0, width, height);
    _mytable.scrollEnabled=NO;
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 4;
}
//-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
//    if(section==0)
//    {
//        return 1;
//    }else{
//    return 6;
//    }
//}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 50;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    if(width==375){
        if (section!=3) {
            return 5;
        }else{
            return 335;
        }
    }else if(width==320){
        if (section!=3) {
            return 5;
        }else{
            return 240;
        }
    }else {
        if (section!=3) {
            return 7;
        }else{
            return 400;
        }
        
    }
}
- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section {
    
    view.tintColor = [UIColor colorWithRed:238.0/255 green:238.0/255 blue:238.0/255 alpha:1];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *id=@"row";
    cell=[tableView dequeueReusableCellWithIdentifier:id];
    if (cell==nil)
    {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:id];
    }
    NSArray *row1=[cell.contentView subviews];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    for (UIView *vv2 in row1)
    {
        [vv2 removeFromSuperview];
    }
    
    //    cell.layer.shadowOffset = CGSizeMake(0, 1);
    //    cell.layer.shadowColor = [UIColor grayColor].CGColor;
    //    cell.layer.shadowRadius = 1;
    //    cell.layer.shadowOpacity = .5f;
    //    CGRect shadowFrame = cell.layer.bounds;
    //    CGPathRef shadowPath = [UIBezierPath
    //                            bezierPathWithRect:shadowFrame].CGPath;
    //    cell.layer.shadowPath = shadowPath;
    if (indexPath.section==0) {
        if (indexPath.row==0) {
            UIImageView*vv1=[[UIImageView alloc]initWithFrame:CGRectMake(20, 5, 25, 40)];
            vv1.image = [UIImage imageNamed:@"ddl1.jpg"];
            [cell.contentView addSubview:vv1];
            UILabel*ll1=[[UILabel alloc]initWithFrame:CGRectMake(60, 10, 100, 30)];
            ll1.font=[UIFont systemFontOfSize:14.0f];
            ll1.text=@"退款管理";
            [cell.contentView addSubview:ll1];
            
        }
    }else if(indexPath.section==1){
        UIImageView*vv1=[[UIImageView alloc]initWithFrame:CGRectMake(20, 5, 25, 40)];
        vv1.image = [UIImage imageNamed:@"ddl2.jpg"];
        [cell.contentView addSubview:vv1];
        UILabel*ll1=[[UILabel alloc]initWithFrame:CGRectMake(60, 10, 100, 30)];
        ll1.font=[UIFont systemFontOfSize:14.0f];
        ll1.text=@"售后管理";
        [cell.contentView addSubview:ll1];
        
    }else if(indexPath.section==2){
        UIImageView*vv1=[[UIImageView alloc]initWithFrame:CGRectMake(20, 5, 25, 40)];
        vv1.image = [UIImage imageNamed:@"ddl3.jpg"];
        [cell.contentView addSubview:vv1];
        UILabel*ll1=[[UILabel alloc]initWithFrame:CGRectMake(60, 10, 100, 30)];
        ll1.font=[UIFont systemFontOfSize:14.0f];
        ll1.text=@"投诉管理";
        [cell.contentView addSubview:ll1];
    }else if(indexPath.section==3){
        UIImageView*vv1=[[UIImageView alloc]initWithFrame:CGRectMake(20, 5, 25, 40)];
        vv1.image = [UIImage imageNamed:@"ddl4.jpg"];
        [cell.contentView addSubview:vv1];
        UILabel*ll1=[[UILabel alloc]initWithFrame:CGRectMake(60, 10, 100, 30)];
        ll1.font=[UIFont systemFontOfSize:14.0f];
        ll1.text=@"咨询回复";
        [cell.contentView addSubview:ll1];
    }
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    [tableView deselectRowAtIndexPath:indexPath animated:NO];
    if (indexPath.section==0) {
        tuikuanguanliViewController*tuikuan=[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"tuikuanguanli"];
        [self.navigationController pushViewController:tuikuan animated:YES];
    }else if(indexPath.section==1){
        shouhouguanliViewController*tuikuan=[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"shouhouguanli"];
        [self.navigationController pushViewController:tuikuan animated:YES];
        
    }else if(indexPath.section==2){
        tousuguanliViewController*tuikuan=[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"tousuguanli"];
        [self.navigationController pushViewController:tuikuan animated:YES];
        
    }else{
        zixunhuifuViewController*tuikuan=[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"zixunhuifu"];
        [self.navigationController pushViewController:tuikuan animated:YES];
        
    }
    
}
/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
